﻿using System.Web.Hosting;

namespace ErrorDumper.Web {
    public class WebExceptionDataSource : DefaultExceptionDataSource {
        protected override void Initialize() {
            base.Initialize();
            if (string.IsNullOrWhiteSpace(PhysicalPath)) {
                if (string.IsNullOrWhiteSpace(VirtualPath))
                    VirtualPath = "~/App_Data/ErrorDump";
                if (VirtualPath.StartsWith("~"))
                    PhysicalPath = HostingEnvironment.MapPath(VirtualPath);
            }
        }
    }
}
